package com.example.demo.service.serviceimpl;

import com.example.demo.dao.GoodsDao;
import com.example.demo.dao.daoimpl.GoodsDaoImpl;
import com.example.demo.entity.Goods;
import com.example.demo.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired(required = false)
    GoodsDao goodsDao=new GoodsDaoImpl();

    @PostConstruct
    public void init(){
        this.goodsDao=new GoodsDaoImpl();
    }

    @Override
    public List<Goods> goodsList() {
        return goodsDao.goodsList();
    }
}
